package com.itheima.thread.communication.demo04;

import java.util.concurrent.locks.ReentrantLock;

public class BoxDemo {

    public static void main(String[] args) {

        Box box = new Box();

        ReentrantLock reentrantLock = new ReentrantLock();

        ProducerThread producerThread = new ProducerThread(box, reentrantLock);

        CustomerThread customerThread = new CustomerThread(box, reentrantLock);

        Thread t1 = new Thread(producerThread);
        Thread t2 = new Thread(customerThread);

        t1.start();
        t2.start();

    }

}
